<html>
<body>
<p id="p1">Click the button to see the result...</p>
<button onclick="myFunction()">click</button>

<script>
function myFunction()
{
	var x="a,b,c,d,e";
	var y=x.split(",");
	document.getElementById("p1").innerHTML=y[1];
}
</script>

</body>
</html>

